#include<stdio.h>
int Ifin(int restryear,int compyyear,int y)
{
    if(restryear>y)
    {
        return 0;
    }
    else
    {
        if(y>=compyyear)
        {
            return 2;
        }
        else
        {
            return 1;
        }
    }
}
int main()
{
    int restryear,compyyear,y1,y2;
    scanf("%d %d %d %d",&restryear,&compyyear,&y1,&y2);
    int judge1 = Ifin(restryear,compyyear,y1);
    int judge2 = Ifin(restryear,compyyear,y2);
    if((judge1+judge2)==0)
    {
        printf("%d-N %d-N\n",y1,y2);
    }
    else if(judge1==1&&judge2==0)
    {
        printf("%d-Y %d-N\n",y1,y2);
    }
    else if(judge1==0&&judge2==1)
    {
        printf("%d-N %d-Y\n",y1,y2);
    }
    else
    {
        printf("%d-Y %d-Y\n",y1,y2);
    }
    switch(judge1)
    {
        case 0:
            switch(judge2)
            {
                case 0:
                    printf("zhang da zai lai ba");
                    break;
                case 1:
                    printf("2: huan ying ru guan");
                    break;
                case 2:
                    printf("qing 2 zhao gu hao 1");
                    break;
                default:
                    break;
            }
            break;
        case 1:
            switch(judge2)
            {
                case 0:
                    printf("1: huan ying ru guan");
                    break;
                case 1:
                case 2:
                    printf("huan ying ru guan");
                    break;
                default:
                    break;
            }
            break;
        case 2:
            switch(judge2)
            {
                case 0:
                    printf("qing 1 zhao gu hao 2");
                    break;
                case 1:
                case 2:
                    printf("huan ying ru guan");
                    break;
                default:
                    break;
            }
            break;
        default:
            break;
    }
    return 0;
}